package com.zb.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zb.annotation.NumberPattern;
import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author WEN
 * @Date 2023/9/13 0013
 **/
@Data
@ApiModel("工单模块对象")
public class WorkModuleVo {
    @ApiModelProperty(value = "模块ID，新增不必传，修改必传")
    private Long id;

    @NotNull(message = "模块类型不能为空")
    @NumberPattern(regexp = "^(1|2|3|4)$", required = true, message = "模块类型参数不合法")
    @ApiModelProperty(value = "模块类型：1-安装，2-维修，3-保养，4-其他", required = true)
    private Integer type;

    @NotBlank(message = "模块名称不能为空")
    @Length(max = 10, message = "模块名称长度限制 10 个字符以内")
    @ApiModelProperty(value = "模块名称", required = true)
    private String name;

    @NotNull(message = "质保天数不能为空")
    @NumberPattern(regexp = "^[1-9]\\d{0,5}$", required = true, message = "质保天数只允许输入 >0，且总长度限制 6 个的字符以内")
    @ApiModelProperty(value = "质保天数", required = true, example = "30")
    private Integer warrantyDay;

    @NotNull(message = "质保状态不能为空")
    @ApiModelProperty(value = "质保状态，是否保外：false-保内，true-保外", required = true, example = "false")
    private Boolean overinsured;

    @NotNull(message = "保内费用不能为空")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, required = true, message = "保内费用最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "保内费用", required = true, example = "0.0")
    private BigDecimal inSourcingPrice;

    @NotNull(message = "保外费用不能为空")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, required = true, message = "保外费用最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "保外费用", required = true, example = "0.0")
    private BigDecimal outSourcingPrice;

    @NotNull(message = "拨打电话类型不能为空")
    @NumberPattern(regexp = "^(0|1)$", required = true, message = "拨打电话类型参数不合法")
    @ApiModelProperty(value = "拨打电话类型：0-关闭，1-必须拨打", required = true, example = "1")
    private Integer callPhoneType;

    @NumberPattern(regexp = "^(1|2|3)$", required = true, message = "预约时间类型参数不合法")
    @ApiModelProperty(value = "预约时间类型：1-不启用，2-24小时，3-预约时间范围", required = true, example = "2")
    private Integer reservationTimeType;

    @JsonFormat(pattern = "HH:mm")
    @ApiModelProperty(value = "预约开始时间，仅传小时", example = "7:00")
    private Date reservationStartTime;

    @JsonFormat(pattern = "HH:mm")
    @ApiModelProperty(value = "预约结束时间，仅传小时", example = "18:00")
    private Date reservationEndTime;

    @NotNull(message = "启用质保工单项不能为空")
    @ApiModelProperty(value = " 是否启用质保工单：false-不启用，true-启用", required = true, example = "true")
    private Boolean enableWarrantyOrder;

    @NotNull(message = "移动报单端展示项不能为空")
    @ApiModelProperty(value = "是否移动报单端展示：false-不显示，true-显示", required = true, example = "true")
    private Boolean mobileCreateOrderShow;

    @NotNull(message = "自动分配客服项不能为空")
    @ApiModelProperty(value = "是否自动分配客服：false-否，true-是", required = true, example = "true")
    private Boolean autoDispatchClient;

    @ApiModelProperty(value = "工单客服分派策略ID", example = "0")
    private Long workClientStrategyId;

    @NotNull(message = "自动分配服务商项不能为空")
    @ApiModelProperty(value = "是否自动分配服务商：false-否，true-是", required = true, example = "true")
    private Boolean autoDispatchNetwork;

    @NotNull(message = "是否启用结单核销码项不能为空")
    @ApiModelProperty(value = "是否启用结单核销码：false-不启用，true-启用", required = true, example = "true")
    private Boolean enableStatementVerifCode;

    @NumberPattern(regexp = "^(1|2)$", message = "结单核销码类型参数不合法")
    @ApiModelProperty(value = "结单核销码类型：1-随机，2-固定；当enableStatementVerifCode=true时生效", example = "1")
    private Integer statementVerifCodeType;

    @ApiModelProperty(value = "是否启用签到：false-关闭，true-开启", required = true, example = "true")
    private Boolean enableSign;

    @ApiModelProperty(value = "签到方式：1-定位签到，2-拍照签到", example = "1")
    private Integer signType;

    @ApiModelProperty(value = "签到范围限制：1-有限制，2-不限制", example = "1")
    private Integer signRangeType;

    @ApiModelProperty(value = "签到范围，单位：米，当sign_type=1且sign_range_type=1时生效", example = "50")
    private Integer signRange;

    @ApiModelProperty(value = "是否启用拍照防伪作弊水印：false-关闭，true-开启，当signType=2时生效", example = "true")
    private Boolean enableSecurityWatermark;

    @ApiModelProperty(value = "是否启用挂起工单：false-关闭，true-开启")
    private Boolean enableSuspend;

    @ApiModelProperty(value = "是否自动挂起审核通过：false-人工审核，true-自动审核通过，当enableSuspend=true时生效")
    private Boolean autoCheckSuspend;

    @NotNull(message = "收货客户商品单价不能为空")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, required = true, message = "收货客户商品单价最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "收货客户商品单价", required = true, example = "0.00")
    private BigDecimal collectCustomerGoodsPrice;

    @NotNull(message = "模块状态不能为空")
    @ApiModelProperty(value = "模块状态：false-启用，true-禁用", required = true, example = "false")
    private Boolean status;

    @ApiModelProperty(value = "工单Sla规则ID")
    private Long workSlaId;
}
